function testable(target: any) {
    // 相当于给目标类添加静态属性isTestable
    target.isTestable = true;
}

@testable
class MyTestableClass {
    // ...
}

// -----------------------------------------------
function testable1(isTestable: boolean) {
    return function (target: any) {
        // 相当于给目标类添加静态属性isTestable
        target.isTestable = isTestable;
    };
}

@testable1(true)
class MyTest {
    // ...
}
@testable1(false)
class MyTest1 {
    // ...
}

// -----------------------------------------------
function testable2(target: any) {
    // 相当于给目标类添加静态属性isTestable
    target.prototype.isTestable = true;
}
@testable2
class MyTestable {
    // ...
}

// 如果同一个方法有多个装饰器，会像剥洋葱一样，先从外到内进入，然后由内向外执行。
function dec(id:any) {
    // console.log("外部", id);
    return (target: any, property: any, descriptor: any) => {}
        // console.log(target, property, descriptor);
}

class Example {
    @dec(1)
    // @dec(2)
    method() {
      // ...
      // console.log('method');
      
    }
}

export { MyTestableClass, MyTestable, MyTest, MyTest1, Example };
